#if !defined(ximera_system_apphandler_hpp)
#define ximera_system_apphandler_hpp

// -----------------------------------------------------------

#include <ximera/common/eventargs.hpp>

namespace ximera { namespace system
{
    class Application;

    struct AppEventArgs : EventArgs
    {
        AppEventArgs(Application& app)
            : app(app) {}

        Application& app;
    };

    struct UpdateEventArgs : AppEventArgs
    {
        UpdateEventArgs(Application& app, Real secs)
            : AppEventArgs(app), secs(secs) {}

        Real secs;
    };

    struct CloseRequestEventArgs : AppEventArgs
    {
        CloseRequestEventArgs(Application& app, bool& allow)
            : AppEventArgs(app), allow(allow) {}

        bool& allow;
    };

    class XIMERA_API AppHandler
    {
    public:
        virtual ~AppHandler() = 0;

        virtual void onStart(AppEventArgs&) {}
        virtual void onUpdate(UpdateEventArgs&) {}
        virtual void onBeforeRender(AppEventArgs&) {}
        virtual void onAfterRender(AppEventArgs&) {}
        virtual void onCloseRequest(CloseRequestEventArgs&) {}
        virtual void onClose(AppEventArgs&) {}
    };
}}

// -----------------------------------------------------------

#endif